package sis.summertest;
/*
 * @auther 顶风少年
 * @mail dfsn19970313@foxmail.com
 * @date 2019-07-23 10:03
 * @notify
 * @version 1.0
 */

import sis.studentinfo.Course;
import sis.studentinfo.DateUtil;
import sis.studentinfo.Session;
import sis.studentinfotest.SessionTest;
import sis.summer.SummerCourseSession;

import java.util.Date;

public class SummerCourseSessionTest extends SessionTest {
    public void testEndDate() {
        Date startDate = DateUtil.createDate(2003, 6, 9);
        Session session = createSession(new Course("ENGL", "200"), startDate);
        Date endDate = DateUtil.createDate(2003, 8, 1);
        assertEquals(endDate, session.getEndDate());
    }

    protected Session createSession(Course course, Date date) {
        return SummerCourseSession.create(course, date);
    }

    public void testString() {
        String a = "你好";
        String b = "你";
        String c = "好";
        b += c;
        assertTrue(a.equals(b));
        assertFalse(c == b);

        String s1 = new String("abc");
        String s2 = new String("abc");
        assertTrue(s1.equals(s2));
        assertFalse(s1==s2);

        s1 = "bcd";
        s2 = "bcd";
        assertTrue(s1.equals(s2));
        assertTrue(s1==s2);
    }

}
